//package com.siegelion.section.my;
//
//import android.content.Intent;
//import android.os.Bundle;
//import android.view.LayoutInflater;
//import android.view.View;
//import android.view.ViewGroup;
//import android.widget.FrameLayout;
//
//import androidx.fragment.app.Fragment;
//
//
//import com.siegelion.R;
//import com.siegelion.plugin.MethodChannelPlugin;
//
//import io.flutter.embedding.android.FlutterFragment;
//import io.flutter.embedding.engine.FlutterEngine;
//import io.flutter.embedding.engine.FlutterEngineCache;
//import io.flutter.embedding.engine.dart.DartExecutor;
//import io.flutter.facade.Flutter;
//import io.flutter.view.FlutterView;
//
//public class DestinationFragment extends Fragment {
//
//    public DestinationFragment() {
//    }
//
//    public static DestinationFragment newInstance() {
//        DestinationFragment fragment = new DestinationFragment();
//        return fragment;
//    }
//
//    @Override
//    public void onCreate(Bundle savedInstanceState) {
//        super.onCreate(savedInstanceState);
//    }
//
//    @Override
//    public View onCreateView(LayoutInflater inflater, ViewGroup container,
//                             Bundle savedInstanceState) {
//        FlutterView flutterView = Flutter.createView(getActivity(),getLifecycle(),"destination");
//        MethodChannelPlugin.registerWith(flutterView);
//        return flutterView;
//    }
////    public FlutterView openFlutter(){
////        FlutterEngine mFlutterEngine;
////        mFlutterEngine = new FlutterEngine(getContext());
////        mFlutterEngine.getDartExecutor().executeDartEntrypoint(
////                DartExecutor.DartEntrypoint.createDefault()
////        );
////        mFlutterEngine.getNavigationChannel().setInitialRoute("route1");
////        // 通过FlutterView引入Flutter编写的页面
////        FlutterView flutterView = new io.flutter.embedding.android.FlutterView(getContext());
////        FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(
////                ViewGroup.LayoutParams.MATCH_PARENT,
////                ViewGroup.LayoutParams.MATCH_PARENT);
////        FrameLayout flContainer = findViewById(R.id.fl_container);
////        flContainer.addView(flutterView, lp);
////        // 关键代码，将Flutter页面显示到FlutterView中
////        flutterView.attachToFlutterEngine(mFlutterEngine);
////        //return flutterView;
////    }
//}
